import request from '@/utils/request'

// 创建新闻
export function createArtile(data) {
  return request({
    url: '/nkycontent/artile/create',
    method: 'post',
    data: data
  })
}

// 更新新闻
export function updateArtile(data) {
  return request({
    url: '/nkycontent/artile/update',
    method: 'put',
    data: data
  })
}

// 删除新闻
export function deleteArtile(id) {
  return request({
    url: '/nkycontent/artile/delete?id=' + id,
    method: 'delete'
  })
}

// 获得新闻
export function getArtile(id) {
  return request({
    url: '/nkycontent/artile/get?id=' + id,
    method: 'get'
  })
}

// 获得新闻分页
export function getArtilePage(query) {
  return request({
    url: '/nkycontent/artile/page',
    method: 'get',
    params: query
  })
}

// 导出新闻 Excel
export function exportArtileExcel(query) {
  return request({
    url: '/nkycontent/artile/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
